﻿@{
    ViewBag.Title = "Index";
}
<style type="text/css">
    .kmsg { position: absolute; left: 134px; width: auto; height: 265px; }
    .go_search { width: 300px; }
    .go_search .gsc-input td, .go_search .gsc-input tddiv { padding: 0 0 0 0; margin: 0 0 0 0; height: 23px; }
    .go_search .gsc-input input:focus { border: none; }
    .go_search .gsc-input input { border: none; height: 23px; width: 100%; padding: 0px; border: none; margin: 0px; height: auto; outline: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; background-image: url(../img/google_custom_search_watermark.gif?20140625); background-color: rgb(255, 255, 255); background-position: 0% 50%; background-repeat: no-repeat no-repeat; }
</style>
<div>
    測試js壓縮，css壓縮
</div>
@Scripts.Render("~/Content/SiteJs")

<script type="text/javascript">
    window.pageConfig = {
        compatible: true,
        preload: false,
        navId: "jdhome2016",
        timestamp: 1538182461000,
        isEnablePDBP: 0,
        surveyTitle: "调查问卷",
        surveyLink: "//surveys.jd.com/index.php?r=survey/index/sid/889711/newtest/Y/lang/zh-Hans",
        leftCateABtestSwitch: 0,
        "": ""
    };

    //地圖維修範圍
    var _googMap,
        //服務範圍
        _serviceGoogleMap,
        //地圖中白色的消息窗口
        infoWindow;

    //frameMap_Service服務範圍，frameMap維修範圍
    function initMap() {
        //維修範圍
        _googMap = new google.maps.Map(document.getElementById('frameMap'), {
            center: new google.maps.LatLng(30.659634242460026, 104.06582974016158),
            zoom: 13,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            mapTypeControl: false,
            scaleControl: false,
            streetViewControl: false,
            zoomControl: false
        });
        //服務範圍
        _serviceGoogleMap = new google.maps.Map(document.getElementById('frameMap_Service'), {
            center: new google.maps.LatLng(30.659634242460026, 104.06582974016158),
            zoom: 13,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            mapTypeControl: false,
            scaleControl: false,
            streetViewControl: false,
            zoomControl: false
        });

        //map = _googMap;
        infoWindow = new google.maps.InfoWindow;

        //加載服務範圍測試：
        //var areaList = [];
        //var oneArea = {
        //    ContactNumber: "13402862946"
        //    , Contacts: "武三思"
        //    , FullAddress: "An GiangHuyện An PhúThị trấn An PhúNguyễn Hữu Cảnh, TT. An Phú, An Phú, An Giang, 越南"
        //    , MapScope: "10.78863895679218,105.09837265717772;10.78952424806234,105.09120579468993;10.77898489712721,105.09219284760741;10.78290557880705,105.10167713868407"
        //    , NetworkName: "千机网海外版测试仓库"
        //    , NetworkSysNo: 426854942884499460
        //    , SysNo: 429078848466849800
        //};
        //areaList.push(oneArea);
        //pageObj.fun.loadPolygon(areaList);
        setTimeout(function () {
            //先加載服務範圍
            pageObj.fun.getWhUrgentDeliveryScope(_serviceGoogleMap, pageObj.urlArr.url_WhDeliveryScope, 1);
            //再加載維修服務範圍
            pageObj.fun.getWhUrgentDeliveryScope(_googMap, pageObj.urlArr.url_getWhUrgentDeliveryScope, 2);
        }, 100);
    }

    !function () {
        pageObj.fun = {
            //切換地圖
            changeMapArea: function (t) {
                if (t == 1) {
                    //顯示服務範圍
                    $("#frameMap_Service").show();
                    $("#frameMap").hide();
                } else if (t == 2) {
                    //顯示維修範圍
                    $("#frameMap_Service").hide();
                    $("#frameMap").show();
                }
            },

            //弹出消息框
            markerTips: function (msg, position, actvMap) {
                //actvMap當前顯示的地圖
                infoWindow.setContent(msg);
                infoWindow.setPosition(position);
                infoWindow.open(actvMap);
            },
            //加載多邊形，服務範圍
            loadPolygon: function (areaList, actvMap) {
                //多邊形範圍
                var polygonArr = [];
                for (var i = 0; i < areaList.length; i++) {
                    var item = areaList[i];
                    var postions = item.MapScope.split(';');
                    var triangleCoords = [];
                    for (var g = 0; g < postions.length; g++) {
                        var item_g = postions[g];
                        var lat = parseFloat(item_g.split(',')[0]);
                        var lng = parseFloat(item_g.split(',')[1]);
                        if (!isNaN(lat)) {
                            triangleCoords.push({ lat: lat, lng: lng });
                        }
                    }
                    //计算多边形中心坐标
                    var centerLatLng = pageObj.fun.getCenter(triangleCoords);
                    // Construct the polygon.
                    var _old_Polygon = new google.maps.Polygon({
                        paths: triangleCoords,
                        strokeColor: '#FF0000',
                        strokeOpacity: 0.8,
                        strokeWeight: 2,
                        fillColor: '#FF0000',
                        fillOpacity: 0.2,
                        //title:'測試服務範圍1'
                    });

                    //方便选中店铺高亮显示
                    _old_Polygon.SysNo = item.SysNo;
                    //中心坐标
                    _old_Polygon.CenterLatLng = centerLatLng;
                    polygonArr.push(_old_Polygon);

                    _old_Polygon.setMap(actvMap);
                    //清理集合
                    triangleCoords.length = 0;

                    _old_Polygon.info = {
                        id: item.SysNo,
                        name: item.WarehouseName,
                        address: item.CityName + " " + item.AreaName
                        //contact: item.Contacts,
                        //phone: item.ContactNumber
                    };

                    //服務範圍點擊，信息提示
                    _old_Polygon.addListener("click", function (event) {
                        var objInfo = this.info;
                        var msg = objInfo.name + "<br />" +
                            //地址、聯繫人、電話
                            //"WarehouseName:" + objInfo.name + "<br />" +
                            "Address:" + objInfo.address + "<br />";
                        pageObj.fun.markerTips(msg, event.latLng, actvMap);
                    });
                }
                //定位服务范围第一个服务区
                if (polygonArr.length > 0) {
                    var firstOne = polygonArr[0];
                    actvMap.panTo(firstOne.CenterLatLng);
                }
            },

            //计算多边形中心点
            getCenter: function (triangleCoords) {
                var x = 0.0;
                var y = 0.0;
                for (var i = 0; i < triangleCoords.length; i++) {
                    x = x + parseFloat(triangleCoords[i].lat);
                    y = y + parseFloat(triangleCoords[i].lng);
                }
                x = x / triangleCoords.length;
                y = y / triangleCoords.length;
                return new google.maps.LatLng(x, y);
            }

            //獲取此倉庫的服務範圍
            , getWhUrgentDeliveryScope: function (actvMap, url, t) {
                //t=1是服務範圍，2=是維修範圍
                var msgDivDom = $("#mapMsg" + t);
                $.ajax({
                    url: url,
                    type: "post",
                    data: { warehouseSysNo: $("#DefaultWarehouseSysNo").val() },
                    success: function (d) {
                        console.log("t=" + t);
                        console.log(d);
                        console.log('---------------');
                        if (d != null && d.Message != null && !d.Status) {
                            msgDivDom.html("Error during server processing," + d.Message).css("display", "inline-block");
                            return;
                        }
                        var isError = false;
                        if (d != null && d.length > 0) {
                            //檢查經緯度數據是否有效,逗號左邊緯度，右邊經度
                            //确保纬度坐标的首个数值介于 -90 和 90 之间
                            //确保经度坐标的首个数值介于 -180 和 180 之间
                            for (var i = 0; i < d.length; i++) {
                                var itm = d[i];
                                var postions = itm.MapScope.split(';');
                                var triangleCoords = [];
                                for (var g = 0; g < postions.length; g++) {
                                    var item_g = postions[g];
                                    var lat = parseFloat(item_g.split(',')[0]);
                                    var lng = parseFloat(item_g.split(',')[1]);
                                    if (lat < -90 || lat > 90) {
                                        msgDivDom.css("display", "inline-block");
                                        msgDivDom.html("Error:MapScope coordinate value is invalid,Google map to ensure that the first value of latitude coordinates is between -90 and 90");
                                        isError = true;
                                        break;
                                    }
                                    if (lng < -180 || lng > 180) {
                                        msgDivDom.css("display", "inline-block");
                                        msgDivDom.html("Error:MapScope coordinate value is invalid,Google map make sure the first value of the longitude coordinate is between -180 and 180");
                                        isError = true;
                                        break;
                                    }
                                }
                                if (isError) {
                                    break;
                                }
                            }
                            if (!isError) {
                                pageObj.fun.loadPolygon(d, actvMap);
                            }
                        } else {
                            msgDivDom.html("No service range coordinate data").css("display", "inline-block");
                        }
                    }, error: function (jqXHR, textStatus, errorThrown) {
                        console.log(textStatus);
                        if (jqXHR != null) {
                            if (jqXHR.responseText != "") {
                                msgDivDom.html(jqXHR.responseText).css("display", "inline-block");
                            }
                        }
                    }
                });
            }
        };
    }();
</script>

<h2>测试是否处理成功</h2>
中国，四书五经，为欧宝门

<style>
    .hd_lb { width: 295px; height: 370px; position: relative; }
    #hd { }
    .look-talk { width: 310px; }
    .column3mi5 ul { padding-top: 0px; }
    .cxlist li { float: left; width: 98px; height: 115px; margin: 0px 6px; list-style: none; }
    .column3ri { width: 249px; background: #dcdcdd; float: right; padding: 0 13px 7px; }
    .column3ri3 { margin-bottom: 2px; }
    .column3ri3 ul { margin-top: 0px; }
    .cxlist li img { width: 64px; height: 64px; margin: 10px 20px; }
    .cxlist li a { display: block; text-align: center; height: auto; line-height: 17px; padding-left: 0px; color: #000; font-size: 14px; text-decoration: none; }
    .cxlist li a:hover { background: none; height: auto; color: #000; }
    .h90 { height: 117px; overflow: hidden; }
    .h125 { margin-top: 3px; height: 125px; overflow: hidden; }
    ul.h90 { margin-top: 10px; margin-bottom: 15px; }
    ul.h90 li { font-size: 15px; line-height: 24px; font-family: "微软雅黑","宋体"; background: url(/govweb/xhtml/2016gov/images/public/icon_10.jpg) no-repeat 0 13px; padding-left: 10px; }
    ul.h90 a { color: #000; }
    ul.h90 li a:hover { color: #025194; }
    .lmtit a.a_line { background: url(/govweb/xhtml/2016gov/images/public/line.jpg) no-repeat right; padding-right: 15px; margin-right: 12px; float: left; }
    .sth .lmtit img { position: relative; top: 3px; }
    .column3ri { width: 249px; background: #dcdcdd; float: right; padding: 0 13px 10px; }
    .column3ri1 { margin-bottom: 0px; padding-top: 20px; }
    ul.h57 { margin-bottom: 0px; margin-top: 0px; }
    .mb30 { margin-bottom: 30px; }
    .column3ri1 .lmtit { border-bottom: 1px solid #bababa; }


    /*推荐主题*/
    .box20180503 { position: relative; height: 97px; overflow: hidden; margin-top: 10px; margin-bottom: 10px; }
    .two_rmfl_box { position: absolute; left: 0; top: 0; }
    .two_rmfl_box li { float: left; width: 249px; height: 97px; }
    .hot_title_nav20180517 { position: absolute; right: 6px; bottom: 6px; }
    .hot_title_nav20180517 a { float: left; width: 17px; height: 15px; background: #0074bf; text-align: center; line-height: 15px; margin-right: 1px; color: #fff; font-family: "microsoft yahei"; font-size: 12px; }
    .hot_title_nav20180517 a.active { background: #ffba34; }
    /*热门应用*/

    .tit { height: 36px; line-height: 36px; border-bottom: 1px solid #bababa; }
    .tit span { float: left; color: #000000; font-size: 20px; font-family: "FZZHUNYSK","微软雅黑","宋体"; border-bottom: 2px solid #015293; position: relative; top: -1px; }
    .tit span a { color: #000000; font-size: 20px; font-family: "FZZHUNYSK","微软雅黑","宋体"; }
    .tit.yyphb a { display: inline-block; float: left; font-size: 16px; color: #999999; margin: 0 9px; font-family: "微软雅黑"; cursor: pointer; }
    .tit.yyphb b { border-right: 1px solid #999999; }
    ul.two_yyphb_box { margin: 10px 0 10px; height: 251px; *+height: 255px; overflow: hidden; border-radius: 5px; background-color: #fff; border: 1px solid ##cfcfd0; }

    @@-moz-document url-prefix() {
        ul.two_yyphb_box { height: 255px; }
    }
    ul.two_yyphb_box li { height: 42px; overflow: hidden; margin: 0px 10px; padding: 6px 0; border-bottom: 1px solid #bfbfbf; position: relative; }
    ul.two_yyphb_box li .num { float: left; width: 20px; height: 20px; line-height: 20px; text-align: center; color: #fff; background: #959595; border-radius: 2px; margin: 20px 15px 0 10px; }
    ul.two_yyphb_box li .pic { float: left; margin-right: 10px; position: relative; *+margin-top:-3px; }
    ul.two_yyphb_box li .txt p a.h_tit { color: #000; font-size: 15px; font-family: "微软雅黑","宋体"; line-height: 22px; font-weight: normal; }
    ul.two_yyphb_box li .txt p a { font-size: 14px; font-weight: inherit; }
    ul.two_yyphb_box li .txt h3 span a { color: #0078d7; font-size: 16px; }
    ul.two_yyphb_box li .txt p { height: auto; overflow: hidden; }
    ul.two_yyphb_box li .txt p span { float: left; margin-right: 10px; font-size: 14px; height: 18px; border: 1px solid #999999; text-align: center; line-height: 16px; color: #020202; border-radius: 5px; padding: 0 3px; }
    ul.two_yyphb_box li .txt p b a { color: #666666; font-size: 14px; font-family: "微软雅黑"; font-weight: normal; }
    ul.two_yyphb_box li .txt p b { color: #666666; font-size: 14px; font-family: "微软雅黑"; font-weight: normal; cursor: pointer; }
    .yyphb span { border-bottom: 0; }
    .yyphb span.on { border-bottom: 2px solid #015293; }
    .yyphb a.on { color: #000; border-bottom: 2px solid #015293; }
    /*应用排行新加样式*/
    .two_yyphb_box li .pic .yd_ewm { position: absolute; top: -20px; display: none; left: -35px; z-index: 9999; border: 5px solid #fff; }
    .two_yyphb_box li .yyph_ewm_ct { position: absolute; bottom: 33px; z-index: 99999; left: 45px; display: none; }


    /*最新应用*/
    .two_zxyy_box { height: auto; overflow: hidden; margin-top: 15px; }
    .two_zxyy_box a { float: left; width: 120px; height: 136px; text-align: center; font-size: 14px; margin: 0px 2px 5px 2px; font-family: "微软雅黑"; }
    .two_zxyy_box a img { display: block; margin: 0 auto 5px; }
    .two_zxyy_box a span { display: block; line-height: 22px; color: #000000; }
    .two_zxyy_box a b { font-weight: normal; color: #0078d7; letter-spacing: -0.02em; overflow: hidden; font-family: "微软雅黑"; }
    .zx_pop { position: absolute; width: 100%; height: 100%; top: 0px; left: 0px; background: rgba(0, 0, 0, 0.701961); display: none; color: rgb(255, 255, 255); font-size: 12px; font-style: normal; padding-top: 120px; box-sizing: border-box; font-family: 微软雅黑; }
    .two_zxyy_box a img.ewm_ct { position: absolute; left: 65px; top: 47px; z-index: 9999; display: none; }
    /*检索开始*/
    .ser_search { width: 257px; margin: 0 auto 10px; height: auto; overflow: hidden; }
    .ser_search .left { width: 250px; }
    .ser_search .left .zhetie ul { z-index: 9999; background: #fff; position: absolute; width: 79px; border: 1px solid #005393; box-sizing: border-box; display: none; }
    .ser_search .left .zhetie ul li { box-sizing: border-box; padding: 0.3rem 0 0.3rem 0.5rem; font-size: 14px; border-bottom: 1px dashed #005393; }
    .ser_search .left .zhetie h3 { width: 79px; height: 25px; overflow: hidden; margin-bottom: 1px; background-color: #015293; color: #fff; font-size: 14px; line-height: 25px; text-align: center; cursor: pointer; }
    .ser_search .zhetie .left h3 a { float: left; color: #1b1b1b; padding: 0 7px; height: 30px; line-height: 30px; margin-right: 15px; font-size: 14px; }
    .ser_search .zhetie .left h3 a.on { color: #fff; background: #015293; }
    .ser_search .left div { height: auto; overflow: hidden; border: 1px solid #015293; background: url(http://103.66.33.30/images/8/fw_2.jpg) no-repeat 190px center #015293; -moz-border-radius: 5px; /* Firefox */ -webkit-border-radius: 5px; /* Safari 和 Chrome */ border-radius: 5px; /* Opera 10.5+, 以及使用了IE-CSS3的IE浏览器 */ }
    .ser_search .left div input[type=text] { width: 180px; float: left; height: 18px; border: 0; padding: 5px 5px; }
    .ser_search .left div input[type=button] { float: right; width: 56px; height: 26px; border: 0; background: none; cursor: pointer; }
    .ser_search .left p { color: #333333; position: relative; margin-top: 5px; }
    .ser_search .left p a { color: #333333; font-size: 12px; font-family: "宋体"; padding-right: 10px; }
    .ser_search .left p b { font-weight: normal; font-size: 12px; font-family: "宋体"; }
    .ser_search .left p .more { position: absolute; right: 0; color: #878787; font-size: 12px; font-family: "宋体"; padding: 0; top: 4px; }
    .ser_search .right { margin-top: 20px; }
    .right { float: right; }
    .column3ri1_2 { background: none; }
    .mb15 { margin-bottom: 15px; }
    .mb22 { margin-bottom: 22px; }
    .two_fwzt_slide { margin-top: 20px; position: relative; }
    .two_fwzt_slide .prev { width: 6px; height: 55px; background: url(/govweb/xhtml/2016gov/public/pic20181229/larrow.png) no-repeat center; display: block; position: absolute; left: -2px; top: 0; }
    .two_fwzt_slide .next { width: 6px; height: 55px; background: url(/govweb/xhtml/2016gov/public/pic20181229/rarrow.png) no-repeat center; display: block; position: absolute; right: -2px; top: 0; }
    .two_fwzt_slide .bd { width: 229px; margin: 0 auto 10px; overflow: hidden; }
    ul.sjcx { clear: both; list-style: none; margin-top: 15px; }
    ul.sjcx li { float: left; margin: 0px 3px 0px 3px; list-style: none; }
    ul.sjcx li a { color: #0078d7; font-size: 16px; }
    .column3ri2 { padding-top: 5px; }
    .column3ri2_1 { height: 100px; }
    .column3ri2_1 ul li { background: none; }
    .column3ri2_2 li { line-height: 23px; }
    .dys_mb15 { }
    .column3mi6 li { line-height: 24px; }

    .logoLianghui { position: absolute; width: 512px; height: 62px; background: url(/govweb/xhtml/zhuanti/2018lhzfgzbg/images/logoLianghui.png) no-repeat; left: 50%; margin-left: 49px; top: 13px; z-index: 3; }
    .cloud { position: absolute; width: 100%; height: 100%; *height: 1226px; top: 0px; right: 0px; background: url(/govweb/xhtml/zhuanti/2018lhzfgzbg/images/cloud.png) no-repeat top center; -webkit-background-size: cover; background-size: cover; background-size: 100% 100%\9; *background-size: 100% 100%; z-index: -2; }
    .cloud2 { opacity: 0.4; right: 0px; background-position: 0 50% }
    .closeBg { position: absolute; width: 28px; height: 45px; top: 7px; right: 0px; z-index: 999; cursor: pointer; }

    /*服务右侧全国政务服务总门户*/
    .qgzwfwzmh20180530 { float: right; font-family: "微软雅黑","宋体"; font-size: 14px; display: block; line-height: 30px; color: #888888; font-weight: lighter; }
</style>
@Html.Partial("_CommonView")



@section footJs{
    <script>
        // 搜索模块的版本号
        window.suggestModuleVersion = '6.3.1';
        KISSY.config({
            combine: true,
            packages: [{
                name: 'kg',
                base: '//g.alicdn.com/kg/',
                ignorePackageNameInUri: true,
                combine: true
            }, {
                name: 'p',
                base: '//g.alicdn.com/tbh/backup/1.0.2',
                combine: false,
                debug: true
            }],
            modules: {
                combobox: {
                    alias: ['kg/combobox/0.0.2/index']
                },
                'mini-login': {
                    alias: ['kg/mini-login/6.3.7/index']
                },
                xtemplate: {
                    alias: ['kg/xtemplate/4.3.0/index']
                },
                'attr-anim': {
                    alias: ['kg/attr-anim/6.0.3/index']
                }
            }
        });
    </script>

    <script>
        $(document).ready(function () {
            $("#right_area li a").click(function () {
                $("#textPattern").val($(this).attr("title"));
                onMatch();
            });
        });

        function setVisible(idElement, visible) {
            var obj = document.getElementById(idElement);
            obj.style.visibility = visible ? "visible" : "hidden";
        }
        function isValidFields() {
            var textSour = document.getElementById("textSour");
            if (null == textSour.value || textSour.value.length < 1) {
                textSour.focus();
                alert("请输入待匹配文本");
                return false;
            }
            var textPattern = document.getElementById("textPattern");
            if (null == textPattern.value || textPattern.value.length < 1) {
                textPattern.focus();
                alert("请输入正则表达式");
                return false;
            }
            return true;
        }
        function buildRegex() {
            var op = "";
            if (document.getElementById("optionGlobal").checked) op = "g";
            if (document.getElementById("optionIgnoreCase").checked) op = op + "i";
            return new RegExp(document.getElementById("textPattern").value, op);
        }
        function onMatch() {
            if (!isValidFields())
                return false;
            document.getElementById("textMatchResult").value = "";
            var regex = buildRegex();
            var result = document.getElementById("textSour").value.match(regex);
            if (null == result || 0 == result.length) {
                document.getElementById("textMatchResult").value = "（没有匹配）";
                return false;
            }
            if (document.getElementById("optionGlobal").checked) {
                var strResult = "共找到 " + result.length + " 处匹配：\r\n";
                for (var i = 0; i < result.length; ++i)strResult = strResult + result[i] + "\r\n";
                document.getElementById("textMatchResult").value = strResult;
            }
            else {
                document.getElementById("textMatchResult").value = "匹配位置：" + regex.lastIndex + "\r\n匹配结果：" + result[0];
            }
            return true;
        }

    </script>

}